﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using SysCommon.Entity.Business.DCS.View;
using TMSIM.Client.CM.Src.CM.UI.MainFrm;
//using SysCommon.Entity.TMSIM.WS.DCS;

namespace TMSIM.Client.CM.UI.MainFrm
{
    public partial class DangerPlanForm : Form
    {
        public DangerPlanForm()
        {
            InitializeComponent();
        }

        private void btn_Return_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        public void ShowForm(View_DangerPlan_EtyEx ety)
        {
            try
            {
                if (ety != null)
                {
                    //证件编号
                    this.txt_CertificateID.Text = ety.PLAN.NAME;
                    //货物名称
                    this.cmb_CargoName.Text = ety.PLAN.CARGONAME;
                    //货物数量
                    this.txt_CargoNum.Text = ety.PLAN.CARGONUMNAME;
                    //购买企业
                    this.cmb_BuyEnterprise.Text = ety.PLAN.BUYENTERPRISENAME;
                    //运输企业
                    this.cmb_TransferEnterprise.Text = ety.PLAN.TRANSFERENTERPRISENAME;
                    //运输车辆
                    this.cmb_TransferVehicle.Text = ety.PLAN.CARPLATE;
                    //目的地
                    this.txt_ToPosition.Text = ety.PLAN.DESTINATION;
                    //始发地
                    this.txt_FromPosition.Text = ety.PLAN.ORIGINAL;
                    //生效日期
                    this.dtp_AvailableDate.Value = ety.PLAN.AVAILABLEDATE;
                    //失效日期
                    this.dtp_ExpireDate.Value = ety.PLAN.EXPIRATIONDATE;
                    //备注
                    this.txt_Remark.Text = ety.PLAN.REMARK;
                    //驾驶员
                    this.cmb_Driver.DataSource = ety.DRIVERS;// ety.PLAN.DRIVERIDLIST.Split(',');
                    this.cmb_Driver.DisplayMember = "NAME";
                    //押运员
                    this.cmb_Escort.DataSource = ety.ESCORTS;
                    this.cmb_Escort.DisplayMember = "NAME";
                    //上路时间
                    this.cmb_TimeAvailable.DataSource = ety.PLAN.TIMEAVAILABLE.Split(';');
                   
                   
                }
                this.ShowDialog();
            }
            catch(Exception ex)
            {
                SysCommon.Global.mainLog.Error("调用ShowForm(View_DangerPlan_Ety ety)出错", ex);
            }
        }

        private void panel12_Paint(object sender, PaintEventArgs e)
        {

        }

        private void label11_Click(object sender, EventArgs e)
        {

        }
        
    }
}